package org.jdsm.flow.core.simpleblog.dao;

import org.jdsm.flow.core.simpleblog.IComment;
import org.jdsm.flow.core.simpleblog.IPost;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: mikom
 * Date: 11/5/12
 * Time: 11:43 AM
 */
public interface IBlogDAO<T> {
    IPost findPostByKey(T key);

    IPost loadPost(IPost<T> blog);

    IComment findCommentByKey(T key);

    IComment loadComment(IComment<T> blogComment);

    IPost saveOrUpdate(IPost blog);

    IComment saveOrUpdate(IComment blogComment);

    IPost remove(IPost<T> blog);

    IComment remove(IComment blogComment);

    IPost newPostInstance();

    IComment newCommentInstance();

    List<IPost> findLatestPosts(int count);
}
